package net.jlibrary.curbparking.action.vo;

import java.io.Serializable;
import java.util.Date;

import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;

import net.jlibrary.common.CoreConstants;
import net.jlibrary.common.core.annotation.VoForPo;
import net.jlibrary.common.core.entity.BaseVo;
import net.jlibrary.curbparking.domain.Berth;
import net.jlibrary.curbparking.domain.ParkRecord;
import net.jlibrary.curbparking.domain.ParkRecordStatus;
import net.jlibrary.curbparking.domain.PlateNumber;
import net.jlibrary.group.domain.ParkingPlace;

@VoForPo(ParkRecord.class)
public class ParkRecordVo extends BaseVo {
	private static final long serialVersionUID = -3453250229544981371L;
	private Long id;
	private String serialNumber;// 流水号
	private String recordId;// 第三方记录编号
	private PlateNumberVo plateNumber;// 车牌
	private ParkingPlaceVo parkingPlace;// 所在停车区
	private BerthVo berth;// 所在停车区泊位
	@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
	@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
	private Date ingressTime; // 驶入时间
	@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
	@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
	private Date leaveTime; // 驶出时间

	private ParkRecordStatusVo status;// 停车状态
	private double receivable;// 应收费用
	private double deratePrice;// 减免费用
	private double money;// 实收费用
	@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
	@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
	private Date derateTime;// 减免时间
	private boolean push;// 是否已推送
	@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
	@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
	private Date createdate;
	@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
	@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
	private Date lastdate;

	// 将GroupVo写入
	public ParkRecordVo() {
		berth = new BerthVo();
		parkingPlace = new ParkingPlaceVo();
		plateNumber = new PlateNumberVo();
		status = new ParkRecordStatusVo();
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getSerialNumber() {
		return serialNumber;
	}

	public void setSerialNumber(String serialNumber) {
		this.serialNumber = serialNumber;
	}

	public String getRecordId() {
		return recordId;
	}

	public void setRecordId(String recordId) {
		this.recordId = recordId;
	}

	public PlateNumberVo getPlateNumber() {
		return plateNumber;
	}

	public void setPlateNumber(PlateNumberVo plateNumber) {
		this.plateNumber = plateNumber;
	}

	public ParkingPlaceVo getParkingPlace() {
		return parkingPlace;
	}

	public void setParkingPlace(ParkingPlaceVo parkingPlace) {
		this.parkingPlace = parkingPlace;
	}

	public BerthVo getBerth() {
		return berth;
	}

	public void setBerth(BerthVo berth) {
		this.berth = berth;
	}

	public Date getIngressTime() {
		return ingressTime;
	}

	public void setIngressTime(Date ingressTime) {
		this.ingressTime = ingressTime;
	}

	public Date getLeaveTime() {
		return leaveTime;
	}

	public void setLeaveTime(Date leaveTime) {
		this.leaveTime = leaveTime;
	}

	public ParkRecordStatusVo getStatus() {
		return status;
	}

	public void setStatus(ParkRecordStatusVo status) {
		this.status = status;
	}

	public double getReceivable() {
		return receivable;
	}

	public void setReceivable(double receivable) {
		this.receivable = receivable;
	}

	public double getDeratePrice() {
		return deratePrice;
	}

	public void setDeratePrice(double deratePrice) {
		this.deratePrice = deratePrice;
	}

	public double getMoney() {
		return money;
	}

	public void setMoney(double money) {
		this.money = money;
	}

	public Date getDerateTime() {
		return derateTime;
	}

	public void setDerateTime(Date derateTime) {
		this.derateTime = derateTime;
	}

	public boolean isPush() {
		return push;
	}

	public void setPush(boolean push) {
		this.push = push;
	}

	public Date getCreatedate() {
		return createdate;
	}

	public void setCreatedate(Date createdate) {
		this.createdate = createdate;
	}

	public Date getLastdate() {
		return lastdate;
	}

	public void setLastdate(Date lastdate) {
		this.lastdate = lastdate;
	}

	@VoForPo(PlateNumber.class)
	public class PlateNumberVo extends BaseVo {
		private static final long serialVersionUID = -1033985713586781506L;
		private Long id;
		private String plateNumber;// 车牌

		@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
		@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
		private Date createdate;
		@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
		@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
		private Date lastdate;

		public Long getId() {
			return id;
		}

		public void setId(Long id) {
			this.id = id;
		}

		public String getPlateNumber() {
			return plateNumber;
		}

		public void setPlateNumber(String plateNumber) {
			this.plateNumber = plateNumber;
		}

		public Date getCreatedate() {
			return createdate;
		}

		public void setCreatedate(Date createdate) {
			this.createdate = createdate;
		}

		public Date getLastdate() {
			return lastdate;
		}

		public void setLastdate(Date lastdate) {
			this.lastdate = lastdate;
		}

		@Override
		public Serializable getPrimaryKey() {
			// TODO Auto-generated method stub
			return id;
		}

		@Override
		public Serializable getText() {
			// TODO Auto-generated method stub
			return plateNumber;
		}

	}

	@VoForPo(ParkRecordStatus.class)
	public class ParkRecordStatusVo extends BaseVo {
		private static final long serialVersionUID = -1616200913601477125L;
		private Long id;
		private String name;
		private String code;
		private String description;
		private int taxis;
		private boolean valid;
		private boolean allowQueryInvalid;
		private boolean compellingDelete;
		private String parentIsNull;
		private String validString;
		@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
		@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
		private Date createdate;
		@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
		@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
		private Date lastdate;

		public Long getId() {
			return id;
		}

		@Override
		public Serializable getPrimaryKey() {
			return id;
		}

		@Override
		public Serializable getText() {
			return name;
		}

		public void setId(Long id) {
			this.id = id;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		public String getCode() {
			return code;
		}

		public void setCode(String code) {
			this.code = code;
		}

		public String getDescription() {
			return description;
		}

		public void setDescription(String description) {
			this.description = description;
		}

		public int getTaxis() {
			return taxis;
		}

		public void setTaxis(int taxis) {
			this.taxis = taxis;
		}

		public boolean getValid() {
			return valid;
		}

		public void setValid(boolean valid) {
			this.valid = valid;
		}

		public boolean getAllowQueryInvalid() {
			return allowQueryInvalid;
		}

		public void setAllowQueryInvalid(boolean allowQueryInvalid) {
			this.allowQueryInvalid = allowQueryInvalid;
		}

		public boolean getCompellingDelete() {
			return compellingDelete;
		}

		public void setCompellingDelete(boolean compellingDelete) {
			this.compellingDelete = compellingDelete;
		}

		public String getParentIsNull() {
			return parentIsNull;
		}

		public void setParentIsNull(String parentIsNull) {
			this.parentIsNull = parentIsNull;
		}

		public String getValidString() {
			return validString;
		}

		public void setValidString(String validString) {
			this.validString = validString;
		}

		public Date getCreatedate() {
			return createdate;
		}

		public void setCreatedate(Date createdate) {
			this.createdate = createdate;
		}

		public Date getLastdate() {
			return lastdate;
		}

		public void setLastdate(Date lastdate) {
			this.lastdate = lastdate;
		}
	}

	@VoForPo(Berth.class)
	public class BerthVo extends BaseVo {
		private static final long serialVersionUID = -3875856161403191642L;
		private Long id;
		private String code;// 泊位编号
		private double longitude;// 经度
		private double latitude;// 维度
		private int deviceIndex;// 泊位索引值
		@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
		@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
		private Date createdate;
		@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
		@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
		private Date lastdate;

		public Long getId() {
			return id;
		}

		public void setId(Long id) {
			this.id = id;
		}

		public String getCode() {
			return code;
		}

		public void setCode(String code) {
			this.code = code;
		}

		public ParkingPlaceVo getParkingPlace() {
			return parkingPlace;
		}

		public double getLongitude() {
			return longitude;
		}

		public void setLongitude(double longitude) {
			this.longitude = longitude;
		}

		public double getLatitude() {
			return latitude;
		}

		public void setLatitude(double latitude) {
			this.latitude = latitude;
		}

		public int getDeviceIndex() {
			return deviceIndex;
		}

		public void setDeviceIndex(int deviceIndex) {
			this.deviceIndex = deviceIndex;
		}

		public Date getCreatedate() {
			return createdate;
		}

		public void setCreatedate(Date createdate) {
			this.createdate = createdate;
		}

		public Date getLastdate() {
			return lastdate;
		}

		public void setLastdate(Date lastdate) {
			this.lastdate = lastdate;
		}

		@Override
		public Serializable getPrimaryKey() {
			// TODO Auto-generated method stub
			return id;
		}

		@Override
		public Serializable getText() {
			// TODO Auto-generated method stub
			return parkingPlace.getAddress();
		}

	}

	@VoForPo(ParkingPlace.class)
	public class ParkingPlaceVo extends BaseVo {
		private static final long serialVersionUID = -9051354145997328794L;
		private Long id;
		private String address;
		private double longitude;
		private double latitude;
		private int totalFixedspaces;
		private String platePrefix;
		private String code;
		private String fullName;
		private String shortName;
		private boolean valid;
		private String loginMode;
		@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
		@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
		private Date createdate;
		@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
		@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
		private Date lastdate;

		public Long getId() {
			return id;
		}

		public void setId(Long id) {
			this.id = id;
		}

		public String getAddress() {
			return address;
		}

		public void setAddress(String address) {
			this.address = address;
		}

		public double getLongitude() {
			return longitude;
		}

		public void setLongitude(double longitude) {
			this.longitude = longitude;
		}

		public double getLatitude() {
			return latitude;
		}

		public void setLatitude(double latitude) {
			this.latitude = latitude;
		}

		public int getTotalFixedspaces() {
			return totalFixedspaces;
		}

		public void setTotalFixedspaces(int totalFixedspaces) {
			this.totalFixedspaces = totalFixedspaces;
		}

		public String getPlatePrefix() {
			return platePrefix;
		}

		public void setPlatePrefix(String platePrefix) {
			this.platePrefix = platePrefix;
		}

		public String getCode() {
			return code;
		}

		public void setCode(String code) {
			this.code = code;
		}

		public String getFullName() {
			return fullName;
		}

		public void setFullName(String fullName) {
			this.fullName = fullName;
		}

		public String getShortName() {
			return shortName;
		}

		public void setShortName(String shortName) {
			this.shortName = shortName;
		}

		public boolean isValid() {
			return valid;
		}

		public void setValid(boolean valid) {
			this.valid = valid;
		}

		public String getLoginMode() {
			return loginMode;
		}

		public void setLoginMode(String loginMode) {
			this.loginMode = loginMode;
		}

		@Override
		public Serializable getPrimaryKey() {
			// TODO Auto-generated method stub
			return id;
		}

		@Override
		public Serializable getText() {
			// TODO Auto-generated method stub
			return fullName;
		}

		public Date getCreatedate() {
			return createdate;
		}

		public void setCreatedate(Date createdate) {
			this.createdate = createdate;
		}

		public Date getLastdate() {
			return lastdate;
		}

		public void setLastdate(Date lastdate) {
			this.lastdate = lastdate;
		}

	}

	@Override
	public Serializable getPrimaryKey() {
		// TODO Auto-generated method stub
		return id;
	}

	@Override
	public Serializable getText() {
		// TODO Auto-generated method stub
		return recordId;
	}
}
